<form action="/${orgi}/design/query/countviewdo/${reportid!''}/${modelid!''}.html" data-toggle="ajax-noclose-form" data-target="#resultlist" method="post" id="countviewForm">

<div class="artCon">
	<div class="middleArt">
		<div class="rightCon" style="width:100% !important;height:470px;overflow-y:auto;">
		<div class="rs_layout_left">
				<div class="leftList" style="overflow:auto;overflow-x:hidden;float: left;width: 200px;height:440px; border: solid #eee 1px;">				
					<table class="table_style_1" style="text-align: left;">
						<thead>
							<tr>
					             <th style="padding-left:5px;">选择</th>
								 <th><i class="verMidWrap">列名称</i><i class="tbArrow"></i></th>	
								 <th><i class="verMidWrap">统计方式</i><i class="tbArrow"></i></th>
							</tr>
						</thead>
						<tbody>
							<#if coltitles??>
								<#list coltitles as coltitle>
									<#assign flag = false >
									<#if existtitles??>
										<#list existtitles as existtitle>
											<#if existtitle==coltitle>
												<#assign flag = true >
											</#if>
										</#list>
									</#if>
									<tr>
										<td style="padding-left:5px;">
											<input type="checkbox" name="colnames" value="${coltitle!''}">
										</td>
										<td>
											<label></i>${coltitle!''}</label>
										</td>
										<td>
											<select name="type_${coltitle!''}">
												<option value="group">分组</option>
												<option value="count">计数</option>
												<option value="avg">平均</option>
												<option value="sum">合计</option>
											</select>
										</td>
									</tr>
									
								</#list>
							</#if>
						</tbody>
					</table>				
				</div>
				<div style="float: left;"><input type="button" onclick="submitSearchForm('first')" style="margin-left: 10px;margin-top: 200px;" class="subButtonStyle" value="查询"/></div>
				</div>
				<div class="rs_layout_center">
				<div class="rightList" id="resultlist" style="overflow:auto;overflow:auto;float: left;width:540px;height:440px; border: solid #eee 1px;">				
					<h1 style="margin-top: 200px;margin-left: 80px;">请从左侧选择数据进行统计查询。</h1>	
				</div>
				</div>	
				<div class="rs_layout_bottom">
					<div class="papers_1">
							<input type="hidden" name="pageNo" id="pageNo" value="1"/>
							<img class="pageElems" onclick="submitSearchForm('last');" title="上一页" alt="上一页" src="/assets/images/go-previous-view.png"/>			
							<img class="pageElems" onclick="submitSearchForm('next');" title="下一页" alt="下一页" src="/assets/images/go-next-view.png"/>
							
					</div>
				</div>		
			</div>
		<div style="text-align: center;" class="bottomBg">
			<div class="btnWrap">
				
				<input type="button" onclick="closeR3ArtDialog()" class="cancelButtonStyle" value="取消"/>
			</div>
		</div>
	</div>
</div>
</form>
<script>
	function submitSearchForm(action){
		if(action=='next'){
			$("#pageNo").val(parseInt($("#pageNo").val())+1);
		}else if(action=='last'){
			$("#pageNo").val(parseInt($("#pageNo").val())-1);
		}
		if($("input[name='colnames']:checked").length>0){
			$("#countviewForm").submit();
		}else{
			alertMsg("请选择查询列！");
		}
		
	}

</script>